﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI.HtmlControls;

namespace JqueryNet.FormControl.FormHtmlControl
{
    public class JHtmlHead : JHtmlControl
    {
        HtmlHead _Html;
        public JHtmlHead(HtmlHead _html)
            : base(_html)
        {
            _Html = _html;
        }

        public override void Html()
        {
            Value = _Html.InnerHtml;
        }

        public override void Html(Func<string> fun)
        {
            _Html.InnerHtml = fun();
        }

        public override void Html(string value)
        {
            _Html.InnerHtml = value;
        }

        public override void Text()
        {
            Value = _Html.InnerText;
        }

        public override void Text(Func<string> fun)
        {
            _Html.InnerText = fun();
        }

        public override void Text(string value)
        {
            _Html.InnerText = value;
        }

        public override void Attr(string key)
        {
            switch (key.ToLower())
            {
                case "title":
                    Value = _Html.Title;
                    return;
                default:
                    base.Attr(key);
                    return;
            }
        }

        public override void Attr(string key, string value)
        {
            switch (key.ToLower())
            {
                case "title":
                    _Html.Title = value;
                    return;
                default:
                    base.Attr(key, value);
                    return;
            }
        }
    }
}
